package com.lixinyue.working;

public class Person {
    //属性
    private String name;
    private int age;
    //构造器
    public Person()
    {
        System.out.println("构造器内部，最多只能声明一个“this（形参列表）”，用来调用其他的构造器");
    }
    public Person(String name)
    {
        this();
        this.name=name;


    }
    public Person(String name,int age)
    {
            this.age=age;
            this.name=name;

    }
    //方法
    public void setName(String name )
    {
        this.name=name;

    }
    public String getName()
    {
        return name;
    }
    public  void setAge(int age)
    {
        this.age=age;
    }
    public int getAge()
    {
        return age;
    }

}
